package cn.fintecher.pangolin.service.business.model.request;

import cn.fintecher.pangolin.common.enums.CaseDataStatus;
import cn.fintecher.pangolin.common.enums.PublicCaseFlag;
import cn.fintecher.pangolin.entity.mysql.QCaseInfo;
import cn.fintecher.pangolin.service.business.model.BaseQueryRequest;
import com.querydsl.core.BooleanBuilder;
import lombok.Data;

/**
 * @Author wangxiangdong
 * @Description 公共案件查询request
 * @Date 2019/9/2 10:50
 **/

@Data
public class PublicCasesRequest extends BaseQueryRequest {

    public BooleanBuilder generateQueryBuilder() {
        BooleanBuilder booleanBuilder = generateBaseQueryBuilder();
        QCaseInfo caseInfo = QCaseInfo.caseInfo;
        booleanBuilder.and(caseInfo.publicCaseFlag.eq(PublicCaseFlag.PUBLIC_CASE).and(caseInfo.caseDataStatus.notIn(CaseDataStatus.SETTLT, CaseDataStatus.REDUCE)));
        return booleanBuilder;
    }
}
